0
תגובות
כתובת לא עובדת (Yii)
פתח
ilikeme
,
אם אני ניכנס לקישור proverb.html אז אני מציג לי את site/index במקום את site/provern
זה הconfig
זה הController
עריכה:
זה הhtaccess
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
זה הconfig
'urlMangaer' => array
(
'urlFormat' => 'path',
'showScriptName' => false,
'rules' => array
(
'index.html' => 'site/index',
'proverb.html' => 'site/proverb'
)
)
(
'urlFormat' => 'path',
'showScriptName' => false,
'rules' => array
(
'index.html' => 'site/index',
'proverb.html' => 'site/proverb'
)
)
זה הController
<?php
class SiteController extends Controller
{
public function actionIndex()
{
$this->render("index");
}
public function actionProverb()
{
$this->renderText('Proverbs');
}
}
?>
class SiteController extends Controller
{
public function actionIndex()
{
$this->render("index");
}
public function actionProverb()
{
$this->renderText('Proverbs');
}
}
?>
עריכה:
זה הhtaccess
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php